<?php

$pack=$_GET['foldername'];
$project=$_GET['project_name'];
$current_dir=$_GET['current_dir'];

if($current_dir==""){

}

else{
$current_dir=$current_dir."/";
}
if($pack=="")
{
echo "enter name of pack";
exit();
}


$c= "../projects/".$project.'/application/controller/'.$current_dir.$pack;
$m= "../projects/".$project.'/application/model/'.$current_dir.$pack;
$v= "../projects/".$project.'/application/view/'.$current_dir.$pack;
$e= "../projects/".$project.'/application/event_handler/'.$current_dir.$pack;

if(is_dir($c) || is_dir($m) || is_dir($v) || is_dir($e) 
        || is_file($c.".php") || is_file($m.".php") || is_file($v.".php") || is_file($e.".php")){
    
    echo "Folder or pack name conflict occured.";
    exit();
}


mkdir($c);
mkdir($m);
mkdir($v);
mkdir($e);

echo "Folder was successfully Created!";
?>
